Author Id: 12616 Author Name: VGS Post Content: Empezaremos por el Dual Screen Creamos un script con el nombre de "Dual Screen" y dentro pegamos este script. [SPOILER="Dual Screen"]#=============================================================================== # * Dual Screen Script for Pokemon Essentials # * By Crazyninjaguy # * [url=http://www.planetdev.net]PlanetDev :: Welcome![/url] #=============================================================================== # If you like this script, please register on my site :) # [url=http://www.planetdev.net]PlanetDev :: Welcome![/url] #=============================================================================== module Graphics @@fadeoutvp=Viewport.new(0,0,485,685) @@fadeoutvp.z=0x3FFFFFFF @@fadeoutvp.color=Color.new(0,0,0,0) end class Sprite_Picture def initialize(viewport, picture) @viewport = Viewport.new(0, 0, 480, 680) @picture = picture @sprite = nil update end end module Resolution GetWindowPlacement = Win32API.new('user32','GetWindowPlacement',['l','p'],'l') GetSystemMetrics = Win32API.new('user32', 'GetSystemMetrics',['i'],'i') MoveWindow = Win32API.new('user32','MoveWindow',['l','i','i','i','i','l'],'l') FindWindowEx = Win32API.new('user32','FindWindowEx',['l','l','p','p'],'i') def self.windowloc(window) string = ' ' * 44 Resolution::GetWindowPlacement.call(window,string) windowdetails = string.unpack('L11') result = [] result.push((windowdetails[9] - windowdetails[7])) result.push((windowdetails[10] - windowdetails[8])) result.push(windowdetails[7]) result.push(windowdetails[8]) return result end end class Screen def self.center window = Resolution::FindWindowEx.call(0,0,"RGSS Player",0) width,height = Resolution.windowloc(window)[0..1] screenwidth = Resolution::GetSystemMetrics.call(0) screenheight = Resolution::GetSystemMetrics.call(1) Resolution::MoveWindow.call(window,(screenwidth - width) / 2,(screenheight - height) / 2,width,height,1) end def self.resize2(width,height,x,y) window = Resolution::FindWindowEx.call(0,0,"RGSS Player",0) screenwidth = Resolution::GetSystemMetrics.call(0) screenheight = Resolution::GetSystemMetrics.call(1) Resolution::MoveWindow.call(window,x,y,width,height,1) end def self.move(x,y) window = Resolution::FindWindowEx.call(0,0,"RGSS Player",0) width,height = Resolution.windowloc(window)[0..1] screenwidth = Resolution::GetSystemMetrics.call(0) screenheight = Resolution::GetSystemMetrics.call(1) Resolution::MoveWindow.call(window,x,y,width,height,1) end def self.resize(width,height,center = true) window = Resolution::FindWindowEx.call(0,0,"RGSS Player",0) screenwidth = Resolution::GetSystemMetrics.call(0) screenheight = Resolution::GetSystemMetrics.call(1) if center Resolution::MoveWindow.call(window,(screenwidth - width) / 2,(screenheight - height) / 2,width,height,1) else x,y = Resolution.windowloc(window)[2..3] Resolution::MoveWindow.call(window,x,y,width,height,1) end end def self.half(center = true) window = Resolution::FindWindowEx.call(0,0,"RGSS Player",0) screenwidth = Resolution::GetSystemMetrics.call(0) screenheight = Resolution::GetSystemMetrics.call(1) if center Resolution::MoveWindow.call(window,(screenwidth - 326) / 2,(screenheight - 272) / 2,326,272,1) else x,y = Resolution.windowloc(window)[2..3] Resolution::MoveWindow.call(window,x,y,326,272,1) end end def self.default window = Resolution::FindWindowEx.call(0,0,"RGSS Player",0) screenwidth = Resolution::GetSystemMetrics.call(0) screenheight = Resolution::GetSystemMetrics.call(1) Resolution::MoveWindow.call(window,(screenwidth - 646) / 2,(screenheight / 2) - 273,646,512,1) end end Screen.resize(485,685) #------------------------------------------------- @spacer1=Sprite.new @spacer1.x = 0# Change the # to the value of the displayed graphic's verticle appearance @spacer1.y = 325# Change the # to the value of the displayed graphic's horizontal appearance @spacer1.z = 100 # This sets the priority of the button over other graphics @spacer1.bitmap = RPG::Cache.picture("dload") # defines the graphic #---------------------------------------------- @spacer=IconSprite.new(0, 325) @spacer.setBitmap("Graphics/Pictures/Spacer") @spacer.z = 99999999 #-----------------------------------------------[/SPOILER]En la Carpeta "Pictures" metemos una imagen que llamaremos "Spacer" esta es la que utilizo [IMG]http://img11.imageshack.us/img11/8294/spacerg.png[/IMG] Ahora vallamos con el Mouse Creamos otro script con el nombre de "Mouse" y pegamos este script. [SPOILER="Mouse"]#=============================================================================== # * Mouse Input Module by Dervvulfman # * Mouse.mouse_in_area? added by Crazyninjaguy #=============================================================================== $mouse=IconSprite.new $mouse.setBitmap("Graphics/Icons/Arrow") $mouse.z = 999999999 # Left-Clicking Control--- # 0 = single click action # 1 = double-click action MOUSE_LEFT_ACTION = 0 # Right-Clicking Control-- # 0 = Menu / 'B' pressed # 1 = Stop Movement MOUSE_RIGHT_ACTION = 0 module Mouse @cursor_pos_get = Win32API.new('user32', 'GetCursorPos', 'p', 'i') @cursor_pos_set = Win32API.new('user32', 'SetCursorPos', 'ii', 'i') @cursor_show = Win32API.new('user32', 'ShowCursor', 'L', 'i') @window_find = Win32API.new('user32', 'FindWindowA', %w(p p), 'l') @window_c_rect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i') @window_scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i') @readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l') @key = Win32API.new("user32", "GetAsyncKeyState", 'i', 'i') Left_Click = 1 Right_Click = 2 Middle_Click = 4 MOUSE_BUTTONS = { Left_Click => 1, Right_Click => 2, Middle_Click => 4 } MOUSE_REPEAT = MOUSE_BUTTONS.clone MOUSE_REPEAT.keys.each { |k| MOUSE_REPEAT[k] = [false, false, 10]} @game_window = nil # Set game handle to nil @cursor_show.call(0) # Turn off system mouse def Mouse.click?(button) MOUSE_REPEAT[1] >= 1 end def Mouse.dbclick?(button) MOUSE_REPEAT[1] == 2 end def Mouse.pos(catch_anywhere = true) x, y = screen_to_client(screen_x, screen_y) width, height = client_size if catch_anywhere or (x >= 0 and y >= 0 and x < width and y < height) return x, y else return 0, 0 end end def Mouse.pos_set(x, y) x = [[x, 0].max, 640].min y = [[y, 0].max, 480].min x, y = client_to_screen(x, y) @cursor_pos_set.call(x, y) end def Mouse.pos_x x, y = pos return x end def Mouse.pos_y x, y = pos return y end def Mouse.screen pos = [0, 0].pack('ll') @cursor_pos_get.call(pos) return pos.unpack('ll') end def Mouse.screen_x pos = [0, 0].pack('ll') @cursor_pos_get.call(pos) return pos.unpack('ll')[0] end def Mouse.screen_y pos = [0, 0].pack('ll') @cursor_pos_get.call(pos) return pos.unpack('ll')[1] end def Mouse.client_size rect = [0, 0, 0, 0].pack('l4') @window_c_rect.call(Mouse.hwnd, rect) right, bottom = rect.unpack('l4')[2..3] return right, bottom end def Mouse.hwnd if @game_window.nil? game_name = "\0" * 256 @readini.call('Game','Title','',game_name,255,".\\Game.ini") game_name.delete!("\0") @game_window = @window_find.call('RGSS Player',game_name) end return @game_window end def Mouse.screen_to_client(x, y) return nil unless x and y pos = [x, y].pack('ll') if @window_scr2cli.call(hwnd, pos) != 0 return pos.unpack('ll') else return nil end end def Mouse.update $mouse.x = Mouse.pos_x $mouse.y = Mouse.pos_y MOUSE_BUTTONS.keys.each do |key| temp = MOUSE_REPEAT[key][0] key_pres = @key.call(MOUSE_BUTTONS[key]) != 0 key_trig = temp == key_pres ? 0 : (key_pres ? (MOUSE_REPEAT[key][2].between?(1, 9) ? 2 : 1) : -1) count = key_trig > 0 ? 0 : [MOUSE_REPEAT[key][2]+1, 20].min MOUSE_REPEAT[key] = [key_pres, key_trig, count] end end def Mouse.visible?(visible=true) if visible @cursor_show.call(-1) else @cursor_show.call(0) end end def Mouse.mouse_in_area?(*args) return false if Mouse.pos_x.nil? if args[0].is_a?(Rect) Mouse.pos_x >= args[0].x and Mouse.pos_y >= args[0].y and Mouse.pos_x <= args[0].x + args[0].width and Mouse.pos_y <= args[0].y + args[0].height else Mouse.pos_x >= args[0] and Mouse.pos_y >= args[1] and Mouse.pos_x <= args[0] + args[2] and Mouse.pos_y <= args[1] + args[3] end end end[/SPOILER]En la carpeta "Icons" meteremos una imagen con el nombre de "Arrow" [IMG]http://img197.imageshack.us/img197/745/arrowrz.png[/IMG] A parte tienes que poner esto: Mouse.update $mouse.x = Mouse.pos_x $mouse.y = Mouse.pos_y en donde diga def pbUpdate o algo parecido a "Update" de cada script. Por ejemplo: class PokemonLoadScene def pbUpdate Mouse.update $mouse.x = Mouse.pos_x $mouse.y = Mouse.pos_y pbUpdateSpriteHash(@sprites) end Importante Este script es necesario, por que sin este cuando vallamos al menu opciones dará error. Asi que nos vamos al script de "PokemonOptions" Y desde donde dice "class PokemonOptionScene" [IMG]http://img838.imageshack.us/img838/3646/71975377.png[/IMG] Asta donde termina "pbDeactivateWindows(@sprites)" osea en "end" [IMG]http://img849.imageshack.us/img849/8282/92708611.png[/IMG] BORRAREMOS LO SELECCIONADO y en su lugar insertamos esto [SPOILER="PokemonOptionScene"]class PokemonOptionScene def pbUpdate pbUpdateSpriteHash(@sprites) end def pbStartScene @sprites={} @viewport=Viewport.new(0,0,Graphics.width,Graphics.height) @viewport.z=99999 @sprites["title"]=Window_UnformattedTextPokemon.newWithSize( _INTL("Options"),0,0,Graphics.width,64,@viewport) @sprites["textbox"]=Kernel.pbCreateMessageWindow @sprites["textbox"].letterbyletter=false @sprites["textbox"].text=_INTL("Speech frame {1}.",1+$PokemonSystem.textskin) screensize1=_INTL("{1}x{2}",DEFAULTSCREENWIDTH/2,DEFAULTSCREENHEIGHT/2) screensize2=_INTL("{1}x{2}",DEFAULTSCREENWIDTH,DEFAULTSCREENHEIGHT) # These are the different options in the game. To add an option, define a setter and # a getter for that option. To delete an option, comment it out or delete it. # The game's options may be placed in any order. @PokemonOptions=[ EnumOption.new(_INTL("TEXT SPEED"),[_INTL("SLOW"),_INTL("MID"),_INTL("FAST")], proc { $PokemonSystem.textspeed }, # Getter proc {|value| $PokemonSystem.textspeed=value MessageConfig.pbSetTextSpeed(pbSettingToTextSpeed(value)) } # Setter ), EnumOption.new(_INTL("BATTLE SCENE"),[_INTL("ON"),_INTL("OFF")], proc { $PokemonSystem.battlescene }, proc {|value| $PokemonSystem.battlescene=value } ), EnumOption.new(_INTL("BATTLE STYLE"),[_INTL("SHIFT"),_INTL("SET")], proc { $PokemonSystem.battlestyle }, proc {|value| $PokemonSystem.battlestyle=value } ), EnumOption.new(_INTL("FONT STYLE"),[_INTL("Em"),_INTL("R/S"),_INTL("FRLG"),_INTL("DP")], proc { $PokemonSystem.font }, proc {|value| $PokemonSystem.font=value MessageConfig.pbSetSystemFontName($VersionStyles[value]) } ), NumberOption.new(_INTL("FRAME"),_INTL("TYPE%d"),1,$TextFrames.length, proc { $PokemonSystem.frame }, proc {|value| $PokemonSystem.frame=value MessageConfig.pbSetSystemFrame($TextFrames[value]) } ), EnumOption2.new(_INTL("MAP VIEW"),[_INTL("ORIGINAL"),_INTL("CUSTOM"),_INTL("PERSPECTIVE")], proc { $PokemonSystem.tilemap ? $PokemonSystem.tilemap : 0 }, proc {|value| oldvalue=$PokemonSystem.tilemap $PokemonSystem.tilemap=value if value!=oldvalue ObjectSpace.each_object(TilemapLoader){|o| next if o.disposed?; o.updateClass } end } ), NumberOption.new(_INTL("SPEECH FRAME"),_INTL("TYPE%d"),1,$SpeechFrames.length, proc { $PokemonSystem.textskin }, proc {|value| $PokemonSystem.textskin=value; MessageConfig.pbSetSpeechFrame( "Graphics/Windowskins/"+$SpeechFrames[value]) } ) ] @sprites["option"]=Window_PokemonOption.new(@PokemonOptions,0, @sprites["title"].height,Graphics.width, Graphics.height-@sprites["title"].height) @sprites["option"].viewport=@viewport @sprites["option"].visible=true # Get the values of each option for i in 0...@PokemonOptions.length @sprites["option"]=(@PokemonOptions.get || 0) end pbDeactivateWindows(@sprites) pbFadeInAndShow(@sprites) { pbUpdate } end end [/SPOILER] LISTO :D Nota:El script de "PokemonOptionScene" fue modificado por mi. Créditos: Dervvulfman - Script Mouse. Crazyninjaguy -Script Mouse y Dual Screen. VGS - Arreglar script "PokemonOptionScene".